package com.xuecheng.content.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xuecheng.content.model.dto.TeachplanDto;
import com.xuecheng.content.model.po.CourseTeacher;
import com.xuecheng.content.service.CourseTeacherService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 课程-教师关系表 前端控制器
 * </p>
 *
 * @author itcast
 */
@Slf4j
@RestController
@RequestMapping("courseTeacher")
public class CourseTeacherController {

    @Autowired
    private CourseTeacherService  courseTeacherService;

    @ApiOperation("查询教师管理")
    @ApiImplicitParam(value = "id",name = "教师Id",required = true,dataType = "Long",paramType = "path")
    @GetMapping("/list/{id}")
    public List<CourseTeacher> GetTeacher(@PathVariable Long id){
        LambdaQueryWrapper<CourseTeacher> w = new LambdaQueryWrapper<>();
        w.eq(CourseTeacher::getCourseId,id);
        return courseTeacherService.list(w);
    }
}
